namespace Defiant.SqlServer.PowerShellScriptTask
{
    using System;
    using System.Management.Automation.Host;

    internal class ScriptHostInterfaceRaw : PSHostRawUserInterface
    {
        public override ConsoleColor BackgroundColor
        {
            get
            {
                return Console.BackgroundColor;
            }
            set
            {
            }
        }

        public override Size BufferSize
        {
            get
            {
                return new Size(Console.BufferWidth, Console.BufferHeight);
            }
            set
            {
            }
        }

        public override Coordinates CursorPosition
        {
            get
            {
                throw new NotImplementedException("The method or operation is not implemented.");
            }
            set
            {
                throw new NotImplementedException("The method or operation is not implemented.");
            }
        }

        public override int CursorSize
        {
            get
            {
                return Console.CursorSize;
            }
            set
            {
            }
        }

        public override ConsoleColor ForegroundColor
        {
            get
            {
                return Console.ForegroundColor;
            }
            set
            {
            }
        }

        public override bool KeyAvailable
        {
            get { return Console.KeyAvailable; }
        }

        public override Size MaxPhysicalWindowSize
        {
            get { return new Size(Console.LargestWindowWidth, Console.LargestWindowHeight); }
        }

        public override Size MaxWindowSize
        {
            get { return new Size(Console.LargestWindowWidth, Console.LargestWindowHeight); }
        }

        public override Coordinates WindowPosition
        {
            get
            {
                return new Coordinates(Console.WindowLeft, Console.WindowTop);
            }
            set
            {
            }
        }

        public override Size WindowSize
        {
            get
            {
                return new Size(Console.WindowWidth, Console.WindowHeight);
            }
            set
            {
            }
        }

        public override string WindowTitle
        {
            get
            {
                return "PowerShell Script Task";
            }
            set
            {
            }
        }

        public override void FlushInputBuffer()
        {
        }

        public override BufferCell[,] GetBufferContents(Rectangle rectangle)
        {
            throw new NotImplementedException("The method or operation is not implemented.");
        }

        public override KeyInfo ReadKey(ReadKeyOptions options)
        {
            throw new NotImplementedException("The method or operation is not implemented.");
        }

        public override void ScrollBufferContents(Rectangle source, Coordinates destination, Rectangle clip, BufferCell fill)
        {
            throw new NotImplementedException("The method or operation is not implemented.");
        }

        public override void SetBufferContents(Rectangle rectangle, BufferCell fill)
        {
            throw new NotImplementedException("The method or operation is not implemented.");
        }

        public override void SetBufferContents(Coordinates origin, BufferCell[,] contents)
        {
            throw new NotImplementedException("The method or operation is not implemented.");
        }
    }
}
